package com.six.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.six.core.entity.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.List;


@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    @Select("select DISTINCT p.*from acl_emp_role er join acl_role_permission rp on er.role_id =rp.role_id join acl_permission p on rp.permission_id=p.id where p.is_deleted =0 and er.emp_id=#{id}")
    List<Permission> findPermissionById(Integer id);
}
